package org.yoyo.classroom.service;

import com.baomidou.mybatisplus.plugins.Page;
import org.apache.ibatis.annotations.Param;
import org.yoyo.classroom.domain.po.BookingRule;
import org.yoyo.classroom.domain.po.StudyRoom;
import org.yoyo.classroom.domain.po.StudyRoomCategory;
import org.yoyo.classroom.domain.po.StudyRoomFacility;
import org.yoyo.classroom.domain.vo.SeatWithBookingStatusVO;
import org.yoyo.classroom.domain.vo.StudyRoomDetailVO;
import org.yoyo.classroom.domain.vo.StudyRoomReviewSummary;

import java.util.List;

/**
 * 自习室业务逻辑层接口
 */
public interface StudyRoomService {

    /**
     * 根据ID查询自习室
     * @param id 自习室ID
     * @return 自习室对象
     */
    StudyRoom getStudyRoomById(Long id);

    /**
     * 查询所有自习室
     * @return 自习室列表
     */
    List<StudyRoom> getAllStudyRooms();

    /**
     * 插入自习室
     * @param studyRoom 自习室对象
     * @return 影响的行数
     */
    int addStudyRoom(StudyRoom studyRoom);

    /**
     * 更新自习室
     * @param studyRoom 自习室对象
     * @return 影响的行数
     */
    int updateStudyRoom(StudyRoom studyRoom);

    /**
     * 删除自习室（逻辑删除）
     * @param id 自习室ID
     * @return 影响的行数
     */
    int deleteStudyRoom(Long id);
    //获取热门自习室
    List<StudyRoomReviewSummary> getTopRatedStudyRooms();
    //获取自习室详情
    StudyRoomDetailVO getStudyRoomDetail(Integer roomId);
    //条件查询自习室
    Page<StudyRoom> getStudyRoomsByFilters(int page, int size, Integer type, String facilities, String sort);


    List<StudyRoomCategory> getAllCategories();

    List<StudyRoomFacility> getAllStudyRoomFacilities();

    List<SeatWithBookingStatusVO> getSeatsWithBookingStatus(Long roomId);

    BookingRule getRoomRuleById(Long roomId);

}
